﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TravelGenerator.BusinessObjects.ObjectValidator;

namespace TravelGenerator.BusinessObjects.SavingManagement
{
    public class SaveResult
    {
        #region Properties

        private SaveParameter saveParameter;
        /// <summary>
        /// Gets or sets the save parameter.
        /// </summary>
        /// <value>The save parameter.</value>
        public SaveParameter SaveParameter
        {
            get
            {
                return this.saveParameter;
            }
            set
            {
                this.saveParameter = value;
            }
        }

        private SaveError saveError = SaveError.None;
        /// <summary>
        /// Gets or sets the save error.
        /// </summary>
        /// <value>The save error.</value>
        public SaveError SaveError
        {
            get
            {
                return this.saveError;
            }
            set
            {
                this.saveError = value;
            }
        }

        private CheckResultCollection checkResultCollection;
        /// <summary>
        /// Gets or sets the check result collection.
        /// </summary>
        /// <value>The check result collection.</value>
        public CheckResultCollection CheckResultCollection
        {
            get
            {
                return this.checkResultCollection;
            }
            set
            {
                this.checkResultCollection = value;
            }
        }

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="SaveResult"/> class.
        /// </summary>
        /// <param name="parameter">The parameter.</param>
        private SaveResult(SaveParameter parameter)
        {
            this.SaveParameter = parameter;
        }

        #endregion

        #region Methods

        /// <summary>
        /// Creates the save result.
        /// </summary>
        /// <param name="parameter">The parameter.</param>
        /// <returns></returns>
        public static SaveResult Create(SaveParameter parameter)
        {
            return new SaveResult(parameter);
        }

        #endregion
    }
}
